package fr.generali.sas.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
import javax.validation.constraints.Size;

/**
 * Respresente le flux à envoyé
 * 
 * @author a000eqm
 * 
 */
@Entity(name="fr.generali.sas.domain.Flux")
@Table(name = "FLUX", uniqueConstraints = { @UniqueConstraint(columnNames = { "ID" }) })
public class FluxHibernate implements Flux{

	@Id @GeneratedValue(strategy=GenerationType.AUTO, generator="flux_seq_gen")
	@SequenceGenerator(name="flux_seq_gen", sequenceName="FLUX_SEQ")
	@Column(name = "ID")
	protected Long id;
	
	
	@Size(min = 2, max = 50)
	@Column(name = "CDEINTERMEDIAIRE")
	protected String codeIntermediaire;
	
	
	@Size(min = 2, max = 100)
	@Column(name = "CDEPORTEFEUILLE")
	protected String codePortefeuille;
	
	
	@Size(min = 2, max = 50)
	@Column(name = "IDCLIENT")
	protected String idClient;
	
	
	@Size(min = 2, max = 50)
	@Column(name = "IDSINISTRE")
	protected String idSinistre;
	
	
	@Size(min = 2, max = 50)
	@Column(name = "IDCONTRAT")
	protected String idContrat;
	
	
	@Size(min = 2, max = 30)
	@Column(name = "EMETTEUR")
	protected String emetteur;
	
	
	@Size(min = 2, max = 20)
	@Column(name = "TYPEFLUX")
	protected String typeFlux;
	
	@Column(name = "MODEENVOI")
	protected String modeEnvoi;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DATEENVOI")
	protected Date dateEnvoi;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DATEACK")
	protected Date dateAck;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DATEINSERTION")
	protected Date dateInsertion;
	
	
	@Size(min = 2, max = 4000)
	@Column(name = "CONTENT")
	protected String content;
	
	//@ManyToOne(targetEntity=fr.generali.sas.domain.RequestHibernate.class)
	//protected RequestHibernate numReservation;
	
	@Column(name = "NUMRESERVATION")
	protected String numReservation;
	
	@Version
	private int version; 

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCodeIntermediaire() {
		return codeIntermediaire;
	}

	public void setCodeIntermediaire(String codeIntermediaire) {
		this.codeIntermediaire = codeIntermediaire;
	}

	public String getCodePortefeuille() {
		return codePortefeuille;
	}

	public void setCodePortefeuille(String codePortefeuille) {
		this.codePortefeuille = codePortefeuille;
	}

	public String getIdClient() {
		return idClient;
	}

	public void setIdClient(String idClient) {
		this.idClient = idClient;
	}

	public String getIdSinistre() {
		return idSinistre;
	}

	public void setIdSinistre(String idSinistre) {
		this.idSinistre = idSinistre;
	}

	public String getIdContrat() {
		return idContrat;
	}

	public void setIdContrat(String idContrat) {
		this.idContrat = idContrat;
	}

	public String getEmetteur() {
		return emetteur;
	}

	public void setEmetteur(String emetteur) {
		this.emetteur = emetteur;
	}

	public String getTypeFlux() {
		return typeFlux;
	}

	public void setTypeFlux(String typeFlux) {
		this.typeFlux = typeFlux;
	}

	public String getModeEnvoi() {
		return modeEnvoi;
	}

	public void setModeEnvoi(String modeEnvoi) {
		this.modeEnvoi = modeEnvoi;
	}

	public Date getDateAck() {
		return dateAck;
	}

	public void setDateAck(Date dateAck) {
		this.dateAck = dateAck;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public String getNumRequest() {
		return numReservation;
	}

	public void setNumRequest(String numRequest) {
		this.numReservation = numRequest;
	}

	public Date getDateInsertion() {
		return dateInsertion;
	}

	public void setDateInsertion(Date dateInsertion) {
		this.dateInsertion = dateInsertion;
	}

	public Date getDateEnvoi() {
		return dateEnvoi;
	}

	public void setDateEnvoi(Date dateEnvoi) {
		this.dateEnvoi = dateEnvoi;
	}

}
